#include"comm.hpp"
#include"time.hpp"
#include"fifo.hpp"
#include<string.h>
//服务器发送数据
int main()
{
    
    //std::cout << x_16(k) << st::endl;
    s.test2();//挂接到地址空间
    s.Shmat();
    gpipe.openwait();
    //获取地址空间
    //char* ret = (char*)s.Ret();
    //printf("虚拟地址：%p",ret);
    struct data* add = (struct data*)s.Ret();
    //通过地址空间通信
    char ch = 'A';
    while(ch <= 'F')
    {
        gpipe.Signal();
        
        strcpy(add->status,"最新");
        strcpy(add->lasttime,gettime().c_str());
        strcpy(add->imge,"xxxxxxxx");

        sleep(2);
        // ret[ch-'A'] = ch;
        // ch++;
    }

    s.Shmdt();//去关联

    s.SHmctl();//删除
}